﻿using System;
using System.Drawing;
using System.Globalization;

namespace CharTest
{
    public class CharAnalysis
    {
        private readonly Image _trueImage;
        private readonly Image _falseImage;

        public CharAnalysis(char c, Image trueImage, Image falseImage)
        {
            if (trueImage == null)
            {
                throw new ArgumentNullException("trueImage");
            }
            if (falseImage == null)
            {
                throw new ArgumentNullException("falseImage");
            }
            _trueImage = trueImage;
            _falseImage = falseImage;
            Char = c;

        }

        public char Char { get; private set; }

        public Image Control { get { return char.IsControl(Char) ? _trueImage : _falseImage; } }
        public Image Digit { get { return char.IsDigit(Char) ? _trueImage : _falseImage; } }
        public Image HighSurrogate { get { return char.IsHighSurrogate(Char) ? _trueImage : _falseImage; } }
        public Image Letter { get { return char.IsLetter(Char) ? _trueImage : _falseImage; } }
        public Image LowSurrogate { get { return char.IsLowSurrogate(Char) ? _trueImage : _falseImage; } }
        public Image Lower { get { return char.IsLower(Char) ? _trueImage : _falseImage; } }
        public Image Number { get { return char.IsNumber(Char) ? _trueImage : _falseImage; } }
        public Image Punctuation { get { return char.IsPunctuation(Char) ? _trueImage : _falseImage; } }
        public Image Separator { get { return char.IsSeparator(Char) ? _trueImage : _falseImage; } }
        public Image Surrogate { get { return char.IsSurrogate(Char) ? _trueImage : _falseImage; } }
        public Image Symbol { get { return char.IsSymbol(Char) ? _trueImage : _falseImage; } }
        public Image Upper { get { return char.IsUpper(Char) ? _trueImage : _falseImage; } }
        public Image WhiteSpace { get { return char.IsWhiteSpace(Char) ? _trueImage : _falseImage; } }

        public UnicodeCategory Category { get { return char.GetUnicodeCategory(Char); } }
    }
}